生成dll后,在源码中直接调用就可以,非常方便
public void IniWriteValue(string section, string key, string iValue)public string IniReadValue(string section, string key)public byte[] IniReadValues(string section, string key)【底层实现】 #region 声明读写INI文件的API函数 [DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath); [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key, string defVal, Byte[] retVal, int size, string filePath); #endregion
评论